package com.example.common.base

import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.databinding.ViewDataBinding
import androidx.lifecycle.ViewModel
import com.blankj.utilcode.util.ToastUtils

/***
 *
 * Activity的基类
 */


abstract class BaseActivity<VDB :ViewDataBinding> :AppCompatActivity(){

     lateinit var mDataBinding:VDB

    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        mDataBinding=DataBindingUtil.setContentView(this,getLayoutId())
        initViews()


    }

    fun showMsg(msg : String){
        if (msg.isNullOrEmpty()){
            ToastUtils.showLong(msg)
        }

    }


    abstract fun getLayoutId(): Int
    abstract fun initViews()








}